///////////////////////////////////////////////////////////////////////////////
//-----------------------------------------------------------------------------
#ifndef __SCRIPT_H__
#define __SCRIPT_H__
//-----------------------------------------------------------------------------

#include <Config.h>
#include <lua.hpp>
#include <string>

class	Object;

//-----------------------------------------------------------------------------

class	Script
{
public:

					Script();
	virtual			~Script();

	bool			Load( std::string name );

	bool			IsThisScript( std::string name );

	void			RegisterFunction( std::string name, lua_CFunction func );

	void			RunScript();
	void			RunFunction( std::string name );
	void			RunFunction( std::string name, Object* obj );

private:

	void			Release();

	void			HandleError( int err );

	std::string		m_name;

	lua_State*		m_state;
};

//-----------------------------------------------------------------------------
#endif //__SCRIPT_H__
//-----------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////
